package com.fs.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;

@Data
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
public class ResultVO implements Serializable {
    private Integer status; //0 业务成功；201 业务失败
    private String msg;
    private Object data;

    public static ResultVO fail(){
        return new ResultVO(201,"业务执行失败",null);
    }
    public static ResultVO fail(String msg){
        return new ResultVO(201,msg,null);
    }

    public static ResultVO success(){
        return new ResultVO(200,"业务执行成功",null);
    }

    public static ResultVO success(Object data){
        return new ResultVO(200,"业务执行成功",data);
    }

    public static ResultVO success(String msg, Object data){
        return new ResultVO(200,msg,data);
    }
}
